<h2>Registration</h2>

<form action="" method="post">
	<?php if ( $error['userid_exists'] ): ?>
		<p><i>This username or email address already exists.</i></p>
	<?php endif; ?>
	<?php if ( $error['userid'] ): ?>
		<p><i>Username length should be 4 to 23 characters long, consisting of a-z0-9_.</i></p>
	<?php endif; ?>
	<p>Username:<br /><input type="text" name="userid" value="<?php echo htmlspecialchars($_POST['userid']); ?>"/></p>
	
	<?php if ( $error['user_pass'] ): ?>
		<p><i>Password length should be 4 to 23 characters long, consisting of a-z0-9_.</i></p>
	<?php endif; ?>
	<?php if ( $error['user_pass_copy'] ): ?>
		<p><i>Passwords does not match</i></p>
	<?php endif; ?>
	<p>Passowrd:<br /><input type="password" name="user_pass" /></p>
	<p><input type="password" name="user_pass_copy" /></p>
	
	<?php if ( $error['email'] ): ?>
		<p><i>Invalid email.</i></p>
	<?php endif; ?>
	<?php if ( $error['email_len'] ): ?>
		<p><i>Email addresses should not exceed 39 characters.</i></p>
	<?php endif; ?>
	<?php if ( $error['email_copy'] ): ?>
		<p><i>Email address does not match..</i></p>
	<?php endif; ?>
	<p>Email:<br /><input type="text" name="email" value="<?php echo htmlspecialchars($_POST['email']); ?>"/></p>
	<p><input type="text" name="email_copy" /></p>
	
	<?php if ( $error['sex'] ): ?>
		<p><i>Please choose your gender</i></p>
	<?php endif; ?>
	<p>Gender:<br /><select name="sex"><option value="M">Male</option><option value="F">Female</option></select></p>
	
	<p><input type="submit" value="Зарегистрироваться" /></p>
</form>